/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package org.sbbs.jpaannotation_02;

import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Index;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

/**
 *
 * @author Administrator
 */
@Entity(name = "FirstEntity")
@Table(name = "T_FIRST_TABLE",
        uniqueConstraints = {@UniqueConstraint(
                name = "s_field_unique",
                columnNames = {"s_field"})}, indexes = {
            @Index(columnList = "order_idx desc",name = "first_order_idx")})
public class FirstClass implements Serializable {

    @Id
    @Column(name = "id", nullable = false)
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long id;
    @Column(name = "s_field", nullable = true, length = 50)
    private String sPropety;

    @Column(name = "order_idx", nullable = true)
    private Integer orderIdx;

    public Integer getOrderIdx() {
        return orderIdx;
    }

    public void setOrderIdx(Integer orderIdx) {
        this.orderIdx = orderIdx;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getsPropety() {
        return sPropety;
    }

    public void setsPropety(String sPropety) {
        this.sPropety = sPropety;
    }

}
